home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2982 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: chaos.kulnet.kuleuven.ac.be!usenet
  2. From: Andreas De Troy <andreas.de.troy%psl%pedcc3.kuleuven.ac.be>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: c
  5. Date: 25 Jan 1996 10:23:12 GMT
  6. Organization: KUL
  7. Message-ID: <4e7lmg$ghh@chaos.kulnet.kuleuven.ac.be>
  8. NNTP-Posting-Host: pcip194.psy.kuleuven.ac.be
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
  13.  
  14. news:822503385snz@genesis.demon.co.uk
  15. Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
  16. >In article <1996Jan24.144108.23883@river.tay.ac.uk>
  17. >           insc2mb@river.tay.ac.uk "Mr persil" writes:
  18. >
  19. >>I wonder if anyone can help.  I have written a program to add an word to the
  20. >>end of a text file.  This text file was created using msdos editor.  The c
  21. >>compiler is borland.  I try using the a and a+ modes to append to the end
  22. >>of the file.  I used fprintf(text,word);  but this doesn't seem to add the
  23. >>word to the file.  
  24. >
  25. I sent a mail yesterday about this, but it does not seem to come through.
  26.  
  27. The problem could be that your editor adds an "end-of-file"-marker at the 
  28. end of its file (ASCII-code 26 or 27 [Ctrl-Z], I don't know). The 
  29. fprintf()-function adds its characters AFTER this eof-marker.
  30.  
  31. When you load the file in your editor, it stops reading input when it 
  32. encounters this eof-marker, so it will not let you see what comes after 
  33. it. A binary dump should reveal, however, that the appended words are 
  34. really there.
  35.  
  36. Solutions: 
  37. 1. try another editor; some do *not* append this eof-mark
  38. 2. keep your ASCII-file clean", i.e. do not save it with your editor. The 
  39. Borland-functions will not append eof-marks, so as long as your file is 
  40. exclusively produced by these functions, everything should work fine.
  41.  
  42.